import { BasicColumn } from '@/components/Table';

/**
 *  第一列显示多选
 * 
 *   {
        type: 'selection',
        disabled(row: RowData) {
            return row.name === "123";
        }
    },
 * 
 */
export const columns: BasicColumn[] = [
  {
    type: 'selection',
    disabled(row: any) {
      return row.name === 'disabled';
    },
  } as any,
  {
    title: '名称',
    key: 'modelName',
    width: 150,
  },
  {
    title: '生产厂家',
    key: 'prodFactory',
    width: 150,
  },
  {
    title: '工作电压',
    key: 'workingVoltage',
    width: 100,
  },
  {
    title: '电池寿命',
    key: 'batteryLife',
    width: 100,
    render(row) {
      return `${row.batteryLife} 小时`;
    },
  },
  {
    title: '工作温度',
    key: 'workingTemperature',
    width: 120,
  },
  {
    title: '防护等级',
    key: 'ipRating',
    width: 100,
  },
  {
    title: '创建人',
    key: 'createName',
    width: 120,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 160,
  },
];
